TABLE | NN n/a IE 4 DOM 1 | ||
The TABLE object reflects the TABLE element. Other objects related to the TABLE object are: CAPTION, COL, COLGROUP, TBODY, TD, TFOOT, THEAD, and TR. | |||
HTML Equivalent<TABLE> | |||
Object Model Reference
|
align | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
Defines the horizontal alignment of the element within its surrounding container. | |||
Exampledocument.all.myTable.align = "center" | |||
Value Any of the three horizontal alignment constants: center | left | right. | |||
|
background | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
URL of the background image for the table. If you set a backgroundColor to the element as well, the color appears if the image fails to load; otherwise, the image overlays the color. | |||
Exampledocument.all.myTable.background = "images/watermark.jpg" | |||
Value Complete or relative URL to the background image file. | |||
|
bgColor | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
Background color of the element. This color setting is not reflected in the style sheet backgroundColor property. Even if the BGCOLOR attribute or bgColor property is set with a plain-language color name, the returned value is always a hexadecimal triplet. | |||
Exampledocument.all.myTable.bgColor = "yellow" | |||
Value A hexadecimal triplet or plain-language color name. |
|||
|
border | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
Thickness of the border around the table (in pixels). This is the 3-D border and should not be confused with borders created with style sheets. | |||
Exampledocument.all.myTable.border = 4 | |||
Value An integer value. A setting of zero removes the border entirely in Internet Explorer 4. | |||
|
borderColor | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
Color of the table's border. Internet Explorer applies the color to all four lines that make up the interior border of a cell. Therefore, colors of adjacent cells do not collide. | |||
Exampledocument.all.myTable.borderColor = "salmon" | |||
Value A hexadecimal triplet or plain-language color name. A setting of empty is interpreted as "#000000" (black). |
|||
|
borderColorDark, borderColorLight | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
The 3-D effect of table borders in Internet Explorer is created by careful positioning of light and dark lines around the page's background or default color. You can independently control the colors used for the dark and light lines by assigning values to the borderColorDark (left and top edges of the cell) and borderColorLight (right and bottom edges) properties. Typically, you should assign complementary colors to the pair of properties. There is also no rule that says you must assign a dark color to borderColorDark. The attributes merely control a well-defined set of lines so you can predict which lines of the border change with each attribute. | |||
Exampledocument.all.myTable.borderColorDark = "blue" document.all.myTable.borderColorLight = "cornflowerblue" | |||
Value A hexadecimal triplet or plain-language color name. A setting of empty is interpreted as "#000000" (black). |
|||
|
caption | NN n/a IE 4 DOM | ||
Read-only | |||
Returns a reference to a CAPTION element nested inside the table. From this reference you can access properties and methods of the CAPTION object. This property is available only in the Win32 version of Internet Explorer 4. | |||
Examplevar capText = document.all.myTable.caption.innerHTML | |||
Value Object reference. | |||
|
cellPadding | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
The amount of empty space between the border of a table cell and the content of the cell. Note that this property applies to space inside a cell. Minor adjustments to this property are not as noticeable when the table does not also display borders (in which case the cellSpacing property can assist in adjusting the space between cells). | |||
Exampledocument.all.myTable.cellPadding = "15" | |||
Value A string value for a length in a variety of units or percentage. | |||
|
cellSpacing | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
The amount of empty space between the outer edges of each table cell. If the table has a border, the effect of setting cellSpacing is to define the thickness of borders rendered between cells. Even without a visible border, the readability of a table often benefits from cell spacing. | |||
Exampledocument.all.myTable.cellSpacing = "5" | |||
Value A string value for a length in a variety of units or percentage. | |||
|
clientHeight, clientWidth | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
According to Microsoft's developer documentation, these properties reflect the height and width (in pixels) of the element's content. | |||
Examplevar midHeight = document.all.myTable.clientHeight/2 | |||
Value Integer pixel value. | |||
|
cols | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
The number of columns of the table. The corresponding COLS attribute assists the browser in preparation for rendering the table. Without this attribute, the browser relies on its interpretation of all downloaded TR and TD elements to determine how the table is to be divided. | |||
Exampledocument.all.myTable.cols = 5 | |||
Value Any positive integer. | |||
|
dataFld | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
Used with IE 4 data binding to associate a remote data source column name with individual TD elements inside the table. A DATASRC attribute must also be set for the element. Setting both the dataFld and dataSrc properties to empty strings breaks the binding between element and data source. | |||
Exampledocument.all.inventoryTable.dataFld = "unit_price" | |||
Value Case-sensitive identifier of the data source column. | |||
|
dataPageSize | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
Used with IE 4 data binding, this property advises the browser how many instances of a table row must be rendered to accommodate the number of data source records set by this attribute. See nextPage( ) and previousPage( ) methods for navigating through groups of records. | |||
Exampledocument.all.inventoryTable.dataPageSize = 10 | |||
Value Positive integer. | |||
|
dataSrc | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
Used with IE 4 data binding to specify the name of the remote ODBC data source (such as an Oracle or SQL Server database) to be associated with the element. Content from the data source is specified via the DATAFLD attribute in individual TD elements. A block of contiguous records can be rendered in the table when you also set the DATAPAGESIZE attribute of the table. Setting both the dataFld and dataSrc properties to empty strings breaks the binding between element and data source. | |||
Exampledocument.all.inventoryTable.dataSrc = "#DBSRC3" | |||
Value Case-sensitive identifier of the data source. | |||
|
frame | NN n/a IE 4 DOM 1 | ||||||||||||||||||
Read/Write | |||||||||||||||||||
Which (if any) sides of a table's outer border (set with the BORDER attribute or border property) are rendered. This property does not affect the interior borders between cells. | |||||||||||||||||||
Exampledocument.all.orderForm.frame = "hsides" | |||||||||||||||||||
Value Any one case-insensitive frame constant (as a string):
| |||||||||||||||||||
|
height, width | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
The height and width in pixels of the element. Changes to these values are immediately reflected in reflowed content on the page. | |||
Exampledocument.all.myTable.height = 250 | |||
Value Integer. | |||
|
recordNumber | NN n/a IE 4 DOM n/a | ||
Read-only | |||
Used with data binding, returns an integer representing the record within the data set that generated the element (e.g., a TABLE element whose content is filled via data binding). Values of this property can be used to extract a specific record from an Active Data Objects (ADO) record set. | |||
Example<SCRIPT FOR="tableTemplate" EVENT="onclick"> myDataCollection.recordset.absoluteposition = this.recordNumber ... </SCRIPT> | |||
Value Integer. | |||
|
rules | NN n/a IE 4 DOM 1 | ||||||||||
Read/Write | |||||||||||
Where (if at all) interior borders between cells are rendered by the browser. In addition to setting the table to draw borders to turn the cells into a matrix, you can set borders to be drawn only to separate borders, columns, or any sanctioned cell grouping (THEAD, TBODY, TFOOT, COLGROUP, or COL). The BORDER attribute must be present--either as a Boolean or set to a specific border size--for any cell borders to be drawn. Do not confuse this property with the rules[] collection of styleSheet objects. | |||||||||||
Exampledocument.all.myTable.rules = "groups" | |||||||||||
Value Any one case-insensitive rules constant (as a string):
| |||||||||||
|
scrollHeight, scrollWidth | NN n/a IE 4 DOM n/a | ||
Read-only | |||
The meaning of these two properties is ambiguous based on Microsoft's description and the way they're implemented in the Windows and Macintosh versions of Internet Explorer 4. My best guess is that these properties are intended to measure the height and width (in pixels) of the content of an element even when some of the content cannot be seen unless scrolled with scrollbars. The Macintosh version of the browser interprets this to mean the amount of the content that you can see at any one time. The important point is that for key elements, such as the BODY, the properties mean different things and can disrupt cross-platform operation. | |||
Examplevar midPoint = document.all.myTable.scrollHeight/2 | |||
Value Positive integer or zero. | |||
|
scrollLeft, scrollTop | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
The distance in pixels between the actual left or top edge of the element's physical content and the left or top edge of the visible portion of the content. Setting these properties allows you to use scripts to adjust the scroll of content within a scrollable container, such as text in a TEXTAREA element or an entire document in the browser window or frame. When the content is not scrolled, both values are zero. Setting the scrollTop property to 15 scrolls the document upward by 15 pixels in the window; the scrollLeft property is unaffected unless explicitly changed. The property values change as the user adjusts the scrollbars. | |||
Exampledocument.all.myTable.scrollTop = 40 | |||
Value Positive integer or zero. | |||
|
tabIndex | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
A number that indicates the sequence of this element within the tabbing order of all focusable elements in the document. Tabbing order follows a strict set of rules. Elements that have values other than zero assigned to their tabIndex properties are first in line when a user starts tabbing in a page. Focus starts with the element with the lowest tabIndex value and proceeds in order to the highest value, regardless of physical location on the page or in the document. If two elements have the same tabIndex values, the element that comes earlier in the document receives focus first. Next come all elements that either don't support the tabIndex property or have the value set to zero. These elements receive focus in the order in which they appear in the document. A value of -1 removes the element from tabbing order altogether. Note that the Macintosh user interface does not provide for giving focus to elements other than text and password INPUT fields. | |||
Exampledocument.all.myTable.tabIndex = 6 | |||
Value Integer. | |||
|
tFoot | NN n/a IE 4 DOM n/a | ||
Read-only | |||
Returns a reference to the TFOOT object if one has been defined for the table. If no TFOOT element exists, the value is null. You can access TFOOT element properties and methods through this reference if you like. This property is available only on the Win32 version of Internet Explorer 4. | |||
Examplevar tableFootTxt = document.all.myTable.tFoot.innerText | |||
Value TFOOT object reference. | |||
|
tHead | NN n/a IE 4 DOM n/a | ||
Read-only | |||
Returns a reference to the THEAD object if one has been defined for the table. If no THEAD element exists, the value is null. You can access THEAD element properties and methods through this reference if you like. This property is available only on the Win32 version of Internet Explorer 4. | |||
Examplevar tableHeadTxt = document.all.myTable.tHead.innerText | |||
Value THEAD object reference. | |||
|
blur( ) | NN n/a IE 4 DOM n/a |
Removes focus from the current element and fires an onBlur event (in IE). No other element necessarily receives focus as a result. | |
Returned Value None. | |
Parameters None. |
focus( ) | NN n/a IE 4 DOM n/a |
Gives focus to the current element and fires the onFocus event (in IE). If another element had focus at the time, it receives an onBlur event. | |
Returned Value None. | |
Parameters None. |
nextPage( ), previousPage( ) | NN n/a IE 4 DOM n/a |
Advises the data binding facilities to load the next or previous group of records from the data source to fill the number of records established with the dataPageSize property. | |
Returned Value None. | |
Parameters None. |
refresh( ) | NN n/a IE 4 DOM n/a |
Advises the data binding facilities to reload the current page of data from the data source. If your table is retrieving frequently changing data from a database, you can create a setTimeout( ) loop to invoke document.all.myTable.refresh( ) as often as users would want updated information from the database. | |
Returned Value None. | |
Parameters None. |
rows( ) | NN n/a IE 4 DOM n/a |
An array of all rows of the table. This collection includes all individual rows from row groups (THEAD, TBODY, and TFOOT elements) in the table. | |
Syntaxdocument.all.myTable.rows(i).objectPropertyOrMethod
|
tBodies[ ] | NN n/a IE 4 DOM n/a |
A collection of TBODY objects on the table. By default, there is at least one TBODY object, even if none is explicitly created with an HTML tag. You can access properties and methods of each TBODY object through this reference if you like. But if you also specify an explicit TBODY element, you can go directly to the element via its ID. This collection is available only on the Win32 version of Internet Explorer 4. | |
Syntaxdocument.all.myTable.tBodies(i).objectPropertyOrMethod
|